// import { readInfo } from '@/pages/noticepage/service';
// import { message } from 'antd';
import { menuList, menuNav, queryInfoDetali } from '../service/index';

export default {
  namespace: 'policy',
  state: {
    data: [],
    count: 0,
  },
  effects: {
    *listData({ payload, callback }, { call, put }) {
      const res = yield call(menuList, payload);
      callback && callback(res);
    },
    *navData({ payload, callback }, { call, put }) {
      const res = yield call(menuNav, payload);
      callback && callback(res);
    },
    *queryInfoDetali({ payload, callback }, { call }) {
      const res = yield call(queryInfoDetali, payload);
      callback && callback(res);
    },
  },
  reducers: {
    setLoad(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
